To compress a moving picture efficiently by coding, there have been proposed digital moving picture coding techniques represented by MPEG-2 (ISO/IEC 13818). In this image compression with the MPEG-2 technique, a hybrid conversion including a combination of inter-image motion compensation and DCT (discrete cosine transform) is effected to make further quantization and variable-length coding of a signal resulted from the conversion.
The MPEG-2 technique adopts the bidirectional predictive coding technique to encode a moving picture. This bidirectional predictive coding technique includes three types of coding: intra-frame coding, inter-frame forward predictive coding, and bidirectional predictive coding. Moving pictures encoded by these types of bidirectional predictive coding techniques are called I (intra-coded), P (predicted) and B (bidirectionally coded) pictures, respectively. Also, I, P and B pictures are appropriately combined to form a GOP (group of pictures) structure as a random access code. It should be noted here that generally, I pictures are produced in a largest number, P pictures are in a next largest number and the B pictures are in a smallest number.
To produce an image by encoding a coded bit stream recorded in a recording medium accurately in a decoder at the time of reproduction with a coding method in which I, P and B pictures are produced in different numbers, respectively, such as the MPEG-2 technique, it is necessary to always know the data occupancy in an input buffer in the decoder by means of an encoder.
FIG. 1 shows a transition in data occupancy of an MPEG stream supplied to an input buffer of a decoder. In FIG. 1, a time (t) is indicated on the horizontal axis along which times (t101, t102, t103, . . . ) at which pictures included in the supplied MPEG stream to be decoded are shown, and data occupancy in the input buffer is indicated on the vertical axis.
The input buffer sequentially stores the MPEG streams compressed with the MPEG-2 technique at their respective bit rates. At the time t101 at which a VBV (video buffering verifier) delay (vbv_delay) has elapsed after a time t100 at which the MPEG streams have started being supplied, a first picture will be extracted from the decoder for decoding. The data amount of the picture extracted from the decoder is a sum of picture_size, picture_start_code, sequence_header and GOP_header of that picture. The data amount will be referred to as “image size” hereunder.
Note that also after the time t101, the input buffer will continuously be supplied with MPEG streams in sequence at a predetermined bit rate. Also, at the times t102, t103, . . . elapsing at every ΔDTS (decode time stamp) after the time t101, data in each picture will be extracted by the decoder in an amount corresponding to the image size of that picture. In such an input buffer, an overflow will arise when a difference in total data amount between the supplied MPEG streams and image size of the picture extracted at each ΔDTS is larger than the size of the input buffer, and an underflow will arise when the difference is smaller than that size.
On this account, in the MPEG technique, it is assumed that the encoder has a VBV (video buffering verifier) buffer provided as a virtual buffer corresponding to the input buffer in the decoder in order to control the amount of generated code data. At the encoder, the amount of generated code data is controlled for each picture type not to cause any failure of the VBV buffer, that is, not to cause data underflow or overflow of the VBV buffer.
Note here that new image data is recorded starting at a recording end point on the recording medium such as a magnetic tape on which image data has already been recorded, namely, so-called image splicing is effected, in some cases. Also note that since the DV (digital video) VTR (video tape recorder) in which only intra-frame data is compressed records one frame over 10 tracks, so the splicing can easily be done by making switching from reproduction to recording while the tape is running, and recording image data resulted from compression of a frame to be recorded starting at a next track.
However, with the MPEG-2 technique in which the intra-frame compression is used, it is not possible to record image data on a fixed number of recording tracks because the size of one frame varies. Therefore, the MPEG-2 technique is not capable of easy splicing.
As mentioned above, with the MPEG technique, it is necessary to control the amount of generated code data for each picture so that there will not occur any data underflow or overflow of the input buffer at the time of decoding, and splice new compressed image data to be recorded correspondingly to the size of the VBV buffer. More particularly, to decode image data without any failure of the input buffer even if image data before and after an edition point where splicing is to be done are successively reproduced, it is necessary to acquire VBV_delay and DTS by reading auxiliary data of the existent image data from the recording medium, convert the image data into a data occupancy in the VBV buffer, and set the data occupancy as an initial value for the encoder.
Generally, when the data occupancy is low for the size of the VBV buffer, the picture size will be limited for a picture whose amount of generated code data is large not to underflow the VBV buffer, and thus no sufficient amount of code can be assigned to a complicated image or I picture, which will result in a lower image quality. On the other hand, if the data occupancy is high for the size of the VBV buffer, a stuffing will easily arise to prevent overflowing of the VBV buffer, the effective amount of generated code data is reduced correspondingly, which will also result in a lower image quality. On this account, the initial value of the data occupancy in the VBV buffer has to be set to an optimum value with consideration given to the normal image quality.
The initial value of the data occupancy in the VBV buffer, set based on a VBV delay (VBV_delay) acquired by reading auxiliary data in existent image data from a recording medium will no always be any optimum value and underflow or overflow will take place, which will continuously cause a lower image quality in many cases.